import Vue from 'vue'
import Vuex from 'vuex'
import { createLogger } from "vuex";
import top from './top/index'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production';

export default new Vuex.Store({
  state: {
    name:'丁猛'
  },
  mutations: {
    setName(state,data){
      state.name = data
      console.log(state,data,'................mutatios');
    }
  },
  actions: {
    setName(context,data){
      context.commit('setName',data)
      console.log(data,'................actions');
    }
  },
  modules: {
    top
  },
  plugins: debug ? [createLogger()] : []
})
